using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace QuickLaunch
{
    public partial class ShortcutSettingControl : UserControl
    {
        public ShortcutSettingControl()
        {
            InitializeComponent();

            // initialize the shortcut list
            InitializeShortcutList();
        }

        protected void InitializeShortcutList()
        {
            Dictionary<string, string> shortcuts = Program.qlShortcutSetting.GetSettingTable();
            foreach (string shortcut in shortcuts.Keys)
            {
                ListViewItem item = this.list_Shortcuts.Items.Add(shortcut);
                item.SubItems.Add(FileNameHelper.Shorten(shortcuts[shortcut]));
                item.ToolTipText = shortcuts[shortcut];
            }
        }

        #region Events

        public event SettingChangedEventHandler SettingChanged = null;

        #endregion

        public void SaveChanges()
        {
            
        }

        private void btn_AddShortcut_Click(object sender, EventArgs e)
        {
            ShortcutForm form = new ShortcutForm(null, null);
            if (form.ShowDialog() == DialogResult.OK)
            {
            }
        }

        private void btn_EditShortcut_Click(object sender, EventArgs e)
        {

        }

        private void btn_RemoveShortcut_Click(object sender, EventArgs e)
        {

        }

        private void btn_OpenSource_Click(object sender, EventArgs e)
        {

        }

        private void btn_Refresh_Click(object sender, EventArgs e)
        {

        }

        private void list_Shortcuts_DoubleClick(object sender, EventArgs e)
        {

        }
    }
}
